package picol.view.component;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import picol.controller.Controler;

/**
 *
 * @author Aurélien Marcel - Julien Sanderson
 */
public class IconButton extends JButton implements ViewComponent {

    public IconButton() {
        super();
    }

    public IconButton(String buttonPath) {
        super();
        this.setIcon(new ImageIcon(getClass().getResource(buttonPath)));
        this.setContentAreaFilled(false);
        this.setBorderPainted(false);
    }

    public void subscription(Controler _controler) {
        this.addActionListener(_controler);
    }
}
